{include file="public/head" title="发布订单" keywords="发布订单" description="发布订单" /}

<style>

    .mui-table-view-cell:after{
        background-color:#fff;
    }

</style>

<div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-draggable">
    <!-- 菜单容器 -->

    <div class="mui-inner-wrap">
        <div id="offCanvasContentScroll" class="mui-content mui-scroll-wrapper" style="background-color: #fff;">
            <div class="mui-scroll">
                <header class="tx_head">
                    <p>
                        <a href="javascript:history.go(-1)" class="header_p1"><span class="mui-icon mui-icon-arrowleft"></span></a>
                    <h5>地址列表</h5>

                    </p>
                </header>
                <main>
                    <article class="bdyhk_a">
                        <ul class="bdyhk_a_ul" >
                            {foreach $addr as $vo}
                            <li class="mui-table-view-cell usrinfo" style="padding: 0;">

                                <a href="{:url('editaddr',['id'=>$vo.addr_id])}" class="mui-navigate-right" style="padding-left: 2.2rem;">
                                    {$vo['addr_name']}[{$vo['phone']}]
                                    <span style="color: #bec0c6;    display: block;float: right;margin-right: 3rem;">
                                        {if condition='$vo.isfag eq 1'}
                                            (默认)
                                        {/if}
                                    </span>
                                    <p style="margin-top: -24px;">{$vo['bname']}{$vo['cname']}{$vo['dname']}{$vo['xiangxi']}</p>
                                </a>
                            </li>
                            {/foreach}
                        </ul>
                    </article>
                    <button class="bdyhk_button" id="bank_btn" style="margin-top: 2rem;line-height:1.5rem;font-size: 1rem">新增地址</button>

                </main><br>
                <br>
                <br>
            </div>
        </div>
        <div class="mui-off-canvas-backdrop"></div>
    </div>
</div>
<input type="hidden" name="imgs_0">
<input type="hidden" name="imgs_1">
<input type="hidden" name="imgs_2">
{include file="public/footer"}
</body>



<script type="text/javascript">

    function upimg(i) {
        var reads= new FileReader();
        f=document.getElementById('file_'+i).files[0];
        reads.readAsDataURL(f);
        reads.onload=function (e) {


            $.ajax({
                type:"post",
                url:'{:url("uplaodimg")}',
                dataType:"json",
                data:{file:this.result},
                success: function(data){
                    if(data.code == 1){
                        layer.msg(data.msg, {icon: 6, time: 1000},function(){

                            $('#img_'+i).attr('src',data.data.src);
                            $('input[name="imgs_'+i+'"]').val(data.data.src);
                        });
                    }else{
                        layer.msg(data.msg, {icon: 5, time: 2000});
                    }
                }
            });
        };
    }

    $('#caidanfenlei').bind("click",function () {
        var data =[];
        $.get('{:url("getmenu")}',function (res) {
            data =  res.data;
            var picker = new mui.PopPicker({   //这里注意大小写PopPicker
                layer: 2 ,  //表示三列，即三级菜单或者联动
                buttons:['取消', '确定']     //显示按钮
            });
            console.log(data);
            picker.setData(data);
            //这里代表被选中的元素
            picker.show(function (selectItems) {
                $("#caidanfenlei").val(selectItems[0].text+'-'+selectItems[1].text);
                $("#caidanfenlei_id").val(selectItems[0].value+','+selectItems[1].value);
            })
        });
    });

    $('#data_option').bind("click",function () {
        var dtpicker = new mui.DtPicker(
            {
                type: "date", //设置日历初始视图模式
                beginDate: new Date() //设置开始日期
            }
        );
        dtpicker.show(function (selectItems) {
            $("#data_option").val(selectItems.text)
        })

    });

    $("#bank_btn").click(function(){
        window.location.href = "{:url('addr')}";
    });

</script>

</html>